
    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>赛马问题 - 学习卡片</title>
      <style>
        body { font-family: sans-serif; background-color: #f0f8ff; color: #333; display: flex; flex-direction: column; align-items: center; padding: 50px 20px; }
        .header h1 { font-size: 32px; }
        .grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; width: 100%; max-width: 1200px; }
        .card-container { perspective: 1200px; cursor: pointer; height: 250px; }
        .card { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.7s; border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
        .card-container.flipped .card { transform: rotateY(180deg); }
        .card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; display: flex; flex-direction: column; box-sizing: border-box; border-radius: 16px; background-color: #fff; padding: 24px; }
        .card-back { background-color: #f0fff4; transform: rotateY(180deg); justify-content: space-between; }
        .card-category { font-size: 14px; color: #0052d9; margin-bottom: 8px; font-weight: 500; }
        .card-question { font-size: 20px; font-weight: 500; flex-grow: 1; display: flex; align-items: center; justify-content: center; text-align: center; }
        .card-answer-wrapper { flex-grow: 1; overflow-y: auto; }
        .card-answer { font-size: 15px; line-height: 1.7; }
        .card-footer { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 16px; margin-top: 16px; }
        .card-source { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 12px; margin-top: 12px; }
      </style>
    </head>
    <body>
      <div class="header">
        <h1>赛马问题 - 学习卡片</h1>
      </div>
      <div class="grid-container">
        
    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">理论</div>
          <div class="card-question">“赛马问题”的核心挑战是什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">理论</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">核心挑战是：在有 25 匹马和 5 个赛道，但没有计时器的条件下，用最少的比赛次数选出速度最快的前 3 匹马。</div>
          </div>
          <div class="card-source">来源: 赛马问题 - 题目描述</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">解决25匹马赛跑问题找出前三名，总共需要多少次比赛？请简述其主要步骤。</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">总共最少需要7次比赛。主要步骤分为三步：1. 先将25匹马分5组，每组赛一次，共进行5次比赛。2. 取每组的第一名再进行一次比赛，确定最快的马（第6次比赛）。3. 根据前两步的结果分析，选取有潜力成为第二、三名的马再进行一次比赛，最终确定前三名（第7次比赛）。</div>
          </div>
          <div class="card-source">来源: 赛马问题 - 解题思路</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">逻辑</div>
          <div class="card-question">在确定了最快的马（假设为A1）后，哪些马匹有资格参加决定二、三名的最后一场比赛？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">逻辑</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">根据分析，第一名确定为A1后，第二名可能是A1所在组的第二名(A2)或冠军赛的第二名(B1)；第三名则可能是A3、B1、B2或C1。因此，文档中明确指出让 A2, B1, B2, C1 这几匹马进行最后一次比赛，以确定最终的第二名和第三名。</div>
          </div>
          <div class="card-source">来源: 赛马问题 - 示例代码</div>
        </div>
      </div>
    </div>

      </div>
    </body>
    </html>
